---
title: "Compression Strategy"
description: "Choose a compression format for your bundle distribution."
icon: FileArchive
---

## Supported Formats

- **`zip`** - Standard ZIP format (DEFLATE algorithm). Fast compression and decompression.
- **`tar.gz`** - TAR archive with GZIP compression (LZ77 algorithm). ~10-15% smaller than ZIP.
- **`tar.br`** - TAR archive with [Brotli](https://github.com/google/brotli) compression. ~20-30% smaller than GZIP. Developed by Google for web compression.

## Configuration

Set `compressStrategy` in your `hot-updater.config.ts`:

```ts
import { defineConfig } from 'hot-updater';

export default defineConfig({
  // ... other options
  compressStrategy: 'tar.gz', // 'zip' | 'tar.gz' | 'tar.br'
});
```

## Usage

After setting the compression strategy, deploy your bundle:

```bash
npx hot-updater deploy -p ios
npx hot-updater deploy -p android
```

The bundle will be compressed and deployed using the specified format.

**How it works:**
- The client app automatically detects the compression format (ZIP, GZIP, or Brotli) and decompresses accordingly
- Users download the compressed bundle, reducing bandwidth usage
- Choose a format with better compression ratio to minimize download size and save users' data

<Callout title="Recommendation">
Since the client handles all formats transparently, choose the format with the best compression ratio (`tar.br` or `tar.gz`) to reduce download sizes for your users.
</Callout>
